package com.gmzg.gmzgoffice.works;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.FrameLayout;

import com.gmzg.gmzgoffice.R;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * A simple {@link Fragment} subclass.
 */
public class WorksFragment extends Fragment {


    @BindView(R.id.works_sign)
    FrameLayout mWorksSign;
    @BindView(R.id.works_clock)
    FrameLayout mWorksClock;
    @BindView(R.id.works_approve)
    FrameLayout mWorksApprove;

    public WorksFragment() {
        // Required empty public constructor
    }


    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        // Inflate the layout for this fragment
        View view = inflater.inflate(R.layout.fragment_works, container, false);
        ButterKnife.bind(this, view);
        return view;
    }

    @OnClick({R.id.works_sign,R.id.works_clock, R.id.works_approve})
    public void onClick(View view) {
        Intent intent = null;
        switch (view.getId()) {
            case R.id.works_sign:
                intent = new Intent(getActivity(), SignActivity.class);
                break;
            case R.id.works_clock:
                intent = new Intent(getActivity(),ClockActivity.class);
                break;
            case R.id.works_approve:
                intent = new Intent(getActivity(),ApproveActivity.class);
                break;
        }
        if (intent != null) {
            startActivity(intent);
        }
    }
}
